package com.one.controller;


import com.one.dto.InsertIntoEvaluateResultDetail;
import com.one.dto.Result;
import com.one.dto.SelectBatch;
import com.one.entity.SemesterInfoEntity;
import com.one.entity.SysCollegeEntity;
import com.one.service.SemesterInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 批次表 前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-10-08
 */
@RestController
@RequestMapping("/batch")
public class SemesterInfoController {
    private final SemesterInfoService semesterInfoService;
    public SemesterInfoController(SemesterInfoService semesterInfoService){
        this.semesterInfoService = semesterInfoService;
    }

    //添加批次
    @ApiOperation(value = "增加批次", notes = "增加批次")
    @PostMapping("/insertBatch")
    public Result insertBatch(@RequestBody(required = false) SelectBatch semesterInfoEntity){
        return semesterInfoService.insertBatch(semesterInfoEntity);
    }

    //查询批次
    @ApiOperation(value = "查询批次", notes = "查询批次")
    @PostMapping("/selectBatch")
    public Result selectBatch(@RequestBody(required = false) SemesterInfoEntity semesterInfoEntity){
        return semesterInfoService.selectBatch(semesterInfoEntity);
    }

    //修改批次
    @ApiOperation(value = "修改批次",notes = "修改批次")
    @PostMapping("/updateBatch")
    public Result updateBatch(@RequestBody(required = false) SelectBatch semesterInfoEntity){
        return semesterInfoService.updateBatch(semesterInfoEntity);
    }

    //删除批次
    @ApiOperation(value = "删除批次",notes = "删除批次")
    @PostMapping("/deleteBatch")
    public Result deleteBatch(@RequestBody(required = false) SemesterInfoEntity semesterInfoEntity){
        return semesterInfoService.deleteBatch(semesterInfoEntity);
    }

    //修改状态
    @ApiOperation(value = "修改状态",notes = "修改状态")
    @PostMapping("/updateBatchStatus")
    public Result updateBatchStatus(@RequestBody(required = false) SemesterInfoEntity semesterInfoEntity){
        return semesterInfoService.updateBatchStatus(semesterInfoEntity);
    }

    //批量
    @ApiOperation(value = "批量",notes = "批量")
    @PostMapping("/insert")
    public Result insert(@RequestBody(required = false) InsertIntoEvaluateResultDetail semesterInfoEntity){
        return semesterInfoService.insert(semesterInfoEntity);
    }
}

